<?php

namespace App\Transformers\User;

use App\Models\UserLabel;
use League\Fractal\TransformerAbstract;

class UserLabelsTransformer extends TransformerAbstract
{
    public function transform(UserLabel $userLabel)
    {
        return [
            'id' => $userLabel->id,
            'label_category_id'=>$userLabel->label_category_id ?? '',
            'label_name'=>$userLabel->label_name ?? '',
            'created_at' => $userLabel->created_at ? $userLabel->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $userLabel->updated_at ? $userLabel->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }
}
